<?php
require_once ('../loginStauts.php');
require_once ('../../webconfig.php');
require (SYS_DIR.'/libraries/template.config.php');
require_once (SYS_DIR.'/configs/config.inc.php');
require_once (SYS_DIR.'/libraries/core/DataAccess.php');
require_once (SYS_DIR.'/libraries/core/models/newscategoryModel.php');


$dao=new DataAccess($dbhost, $dbuser, $dbpasswd, $dbname);
$ncmodel=new newscategoryModel($dao); 


if($_POST)
{
	$categoryName=$_POST["CategoryName"];
	$parentId=$_POST["ParentId"];
	$resut=$ncmodel->executeInsert($categoryName,$parentId);
	print_r("OK:".$resut);
}


$arrayList =$ncmodel->executeList();
$smarty->assign("nclist",$arrayList);
$smarty->assign("name",$name);
//print_r($model);
//print_r($model[0]['UserName']);

//print_r($list);
//print_r($name);
//$smarty->assign("name",$name);

$smarty->display('manage/news/newscategoryadd.html');

?>
